package com.dabai.sas.utils;

import android.content.Context;
import android.content.Intent;

import com.dabai.sas.special.DebugMessages;
import com.dabai.sas.special.ErrorMessage;

public class DebugUtils {

    Intent intent;
    Context context;

    public DebugUtils(Context context){
        this.context = context;
        intent = new Intent();
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

    }

    public void showDebugMessage(Object text){
        intent.setClass(context, DebugMessages.class);
        intent.putExtra("message","调试来源:"+context.getClass()+"\n\n"+text.toString());
        context.startActivity(intent);
    }
    public void showErrorMessage(Object text){
        intent.setClass(context, ErrorMessage.class);
        intent.putExtra("message","错误来源:"+context.getClass()+"\n\n"+text.toString());
        context.startActivity(intent);
    }

}
